<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

	<h:head>
		<title>Enter Bid</title>
		<link rel="stylesheet" type="text/css" href="../08/css/styles.css" />
	</h:head> 
	<h:body> 
		<div align="center">
			<table border="5">
				<tr>
					<th class="title">Enter Bid</th>
				</tr>
			</table>
			<p/>
			<fieldset>
				<legend>Parameters for Your Bid</legend>
				<h:form>
					<table>
						<tr>
							<td>User ID: 
								<h:inputText value="#{bidBean2.userID}"
											 required="true"
											 requiredMessage="You must enter a user ID"
											 validatorMessage="ID must be 5 or 6 chars"
											 id="userID">
									 <f:validateLength minimum="5" maximum="6"/>
							 	</h:inputText>
							</td>
							<td>
								<h:message for="userID" styleClass="error"/>
							</td>
						</tr>
						<tr>
							<td>Keyword: 
								<h:inputText value="#{bidBean2.keyword}"
											 required="true"
											 requiredMessage="You must enter a keyword"
											 validatorMessage="Keyword must be at least 3 chars"
											 id="keyword">
								 	<f:validateLength minimum="3"/>
							 	</h:inputText>
							</td>
							<td>
								<h:message for="keyword" styleClass="error"/>
							</td>
						</tr>
						<tr>
							<td>Bid Amount: 
								<h:inputText value="#{bidBean2.bidAmount}" 
											 required="true"
											 requiredMessage="You must enter an amount"
											 validatorMessage="Amount must be a number"
											 validator="#{bidBean2.validateBidAmount}"
											 id="amount"
											 >
								 </h:inputText>
							</td>
							<td>
								<h:message for="amount" styleClass="error"/>
							</td>
						</tr>
						<tr>
							<td>Duration: 
								<h:inputText value="#{bidBean2.bidDuration}"
											 required="true"
											 requiredMessage="You must enter a duration"
											 converterMessage="Duration must be a whole number"
											 validatorMessage="Duration must be 15 days or more"
											 id="duration"
							 				 >
			 				 		<f:validateLongRange minimum="15"/>
				 				</h:inputText>
							</td>
							<td>
								<h:message for="duration" styleClass="error"/>
							</td>
						</tr>
						<tr>
							<th colspan="2">
								<h:commandButton value="Send Bid!" action="#{bidBean2.doBid}" />
							</th>
						</tr>
					</table>
				</h:form>
			</fieldset>
		</div>
	</h:body> 
</html>
